package com.itheima.edu.info.manager.day15;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.InetAddress;
import java.net.MulticastSocket;

public class UdpZuTest {
    public static void main(String[] args) throws IOException {
        MulticastSocket ms=new MulticastSocket(1999);
        DatagramPacket dp=new DatagramPacket(new byte[1024],1024);
        ms.joinGroup(InetAddress.getByName("224.0.66.66"));
        ms.receive(dp);
        System.out.println(new String(dp.getData(),0,dp.getLength()));
    }
}
